function [norm_train_data, norm_test_data] = kdd99_process_data(train_path, test_path)
    % 加载训练数据和测试数据
    train_data = load(train_path);
    test_data = load(test_path);
    
    % 提取数据矩阵（假设.mat文件中变量名为'data'）
    train_matrix = train_data.data;
    test_matrix = test_data.data;
    
    % 分离标签和特征
    train_labels = train_matrix(:, 1);     % 第一列是标签
    train_features = train_matrix(:, 2:end); % 其余列是特征
    
    test_labels = test_matrix(:, 1);       % 第一列是标签
    test_features = test_matrix(:, 2:end);  % 其余列是特征
    
    % 计算训练集的归一化参数
    feature_means = mean(train_features, 1);  % 每列的均值
    feature_stds = std(train_features, 0, 1); % 每列的标准差
    
    % 处理标准差为0的特征（避免除以0）
    zero_std_indices = feature_stds == 0;
    feature_stds(zero_std_indices) = 1;  % 将标准差为0的设为1
    
    % 归一化训练集特征
    norm_train_features = (train_features - feature_means) ./ feature_stds;
    
    % 使用相同参数归一化测试集特征
    norm_test_features = (test_features - feature_means) ./ feature_stds;
    
    % 重新组合标签和归一化后的特征
    norm_train_data = [train_labels, norm_train_features];
    norm_test_data = [test_labels, norm_test_features];
end